package com.jinsi.service.impl;

import com.jinsi.mapper.ScUserMapper;
import com.jinsi.pojo.ScUser;
import com.jinsi.service.ScUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ScUserServiceImpl implements ScUserService {
    @Autowired
    private ScUserMapper mapper;

    @Override
    public ScUser getLoginByAccountAndPwd(String userAccount, String userPwd) {
        ScUser login = mapper.getLoginByAccountAndPwd(userAccount, userPwd);
        return login;
    }

    @Override
    public ScUser getLoginByPhone(String userPhone) {
        ScUser login = mapper.getLoginByPhone(userPhone);
        return login;
    }

    @Override
    public void getRegister(ScUser user) throws Exception {
        int num = mapper.getRegister(user);
        if (num == 0){
            throw new Exception();
        }
    }

}
